package com.school.controller;

import com.school.entity.SelfStatementReport;
import com.school.service.SelfStatementReportService;
import com.school.untils.ResultEntity;
import com.school.untils.ResultUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "自我陈述报告信息管理")
@RestController
@RequestMapping("/selfStatementReport")
public class SelfStatementReportController {
    @Autowired
    SelfStatementReportService selfStatementReportService;

    // 增加
    @ApiOperation("自我陈述报告信息增加")
    @RequestMapping(value = "/add",method = RequestMethod.POST)
    public ResultEntity addSelfStatementReport(@RequestBody SelfStatementReport selfStatementReport){
        return  ResultUtils.build(selfStatementReportService.addSelfStatementReport(selfStatementReport));
    }

    // 更新
    @ApiOperation("自我陈述报告信息更新")
    @RequestMapping(value = "/update",method = RequestMethod.POST)
    public ResultEntity updateSelfStatementReport(@RequestBody SelfStatementReport selfStatementReport){
        return  ResultUtils.build(selfStatementReportService.updateSelfStatementReport(selfStatementReport));
    }

    // 根据条件分页查询
    @ApiOperation("根据条件分页查询")
    @GetMapping("/specificPage")
    public ResultEntity specificPageQuerySelfStatementReportList(SelfStatementReport selfStatementReport, @RequestParam int page, @RequestParam int size){
        return ResultUtils.build(selfStatementReportService.specificPageQuerySelfStatementReportList(selfStatementReport,page,size));
    }
}
